package com.shuda.business.data.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 字段映射配置实体类
 */
@Data
@TableName("t_field_mapping_config")
@Schema(name = "FieldMappingConfigEntity", description = "字段映射配置实体")
public class FieldMappingConfigEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "引擎ID")
    private Long engineId;

    @Schema(description = "源字段名")
    private String sourceField;

    @Schema(description = "目标字段名")
    private String targetField;

    @Schema(description = "字段类型")
    private String fieldType;

    @Schema(description = "转换规则(JSON)")
    private String transformRule;

    @Schema(description = "默认值")
    private String defaultValue;

    @Schema(description = "是否必填")
    private Boolean required;

    @Schema(description = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    private String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "删除标记(0-正常,1-删除)")
    @TableLogic
    private Integer deleted;
}